﻿Imports Entidades
Imports Negocio
Public Class FormRepartidores
    Private rep As Repartidores
    Private datos As daoRepartidores


    Private Sub FormRepartidores_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        rep = New Repartidores()
        datos = New daoRepartidores()
        cargolist()

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        rep.R = Nombre.Text


        If datos.altarepartidor(rep) Then

            ListaRep.Items.Clear()

            cargolist()

        Else
            MsgBox("Problema")
        End If
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    End Sub

    Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click

    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Nombre.TextChanged

    End Sub

    Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ci.TextChanged

    End Sub

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dir.TextChanged

    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub
    Private Sub cargolist()
        datos = New daoRepartidores
        Dim arr As ArrayList = datos.consultarepartidor
        Dim nodo As Repartidores = New Repartidores


        For Each nodo In arr
            ListaRep.Items.Add(nodo.R)

        Next

    End Sub

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListaRep.SelectedIndexChanged

    End Sub
End Class